import { BrowserRouter, RouterProvider } from 'react-router-dom'

import { ConfigProvider, theme } from 'antd'
import { useBearStore } from './store/index'
import router from './router'

function App() {
  const isDark = useBearStore((state: any) => state.isDark)
  return (
    <ConfigProvider
      theme={{
        algorithm: isDark ? theme.defaultAlgorithm : theme.darkAlgorithm
      }}
    >
      <RouterProvider router={router} />
    </ConfigProvider>
  )
}

export default App
